<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改服务类型')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-type-edit" th:object="${service}">
			<input id="id" name="id" type="hidden" th:field="*{id}"/>
			<input id="type" name="type" type="hidden" th:field="*{type}"/>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务名称：</label>
				<div class="col-sm-8">
					<textarea id="name" rows="3" name="name" class="form-control" required th:field="*{name}"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">URL：</label>
				<div class="col-sm-8">
					<textarea  id="url" rows="4" name="url" class="form-control" required th:field="*{url}"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">描述：</label>
				<div class="col-sm-8">
					<textarea id="description"  rows="4" name="description" class="form-control" required th:field="*{description}"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "urlService";
		$("#form-service-add").validate({
			onkeyup: false,
			rules:{
				name:{
					maxlength: 1000,
				},
				url:{
					maxlength: 1000,
				},
				description:{
					maxlength: 1000,
				},
			},
			messages: {
				"name": {
					remote: "名称最长不超过1000字符"
				},
				"url": {
					remote: "名称最长不超过1000字符"
				},
				"description": {
					remote: "名称最长不超过1000字符"
				},
			},
			focusCleanup: true
		});
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/editSave", $('#form-type-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
